import { PartialType } from '@nestjs/mapped-types';
import { CreateUserAccountDto } from './create-user_account.dto';
import { IsNotEmpty, Length, IsString } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger'

export class UpdateUserAccountDto extends PartialType(CreateUserAccountDto) {
    @IsNotEmpty({ message: 'uuid不能为空' })
    public uuid: string;

    @IsNotEmpty({ message: "account不能为空" })
    @IsString({ message: "类型为字符串" })
    @Length(6, 12, { message: "account长度在6-12" })
    @ApiProperty({ description: "账户", example: "123456" })
    public account: string;

    @IsNotEmpty({ message: "oldPassword不能为空" })
    @IsString({ message: "oldPassword类型为字符串" })
    @Length(6, 12, { message: "oldPassword长度在6-12" })
    @ApiProperty({ description: "旧密码", example: "123456aa" })
    public oldPassword: string;

    @IsNotEmpty({ message: "newPassword不能为空" })
    @IsString({ message: "newPassword类型为字符串" })
    @Length(6, 12, { message: "newPassword长度在6-12" })
    @ApiProperty({ description: "新密码", example: "123456aa" })
    public newPassword: string;

}
